<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of disp</title>
  <meta name="keywords" content="disp">
  <meta name="description" content="Command window display of a QTT_TUCKER">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../index.html">Home</a> &gt;  <a href="#">tt2</a> &gt; <a href="index.html">@qtt_tucker</a> &gt; disp.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for tt2/@qtt_tucker&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>disp
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>Command window display of a QTT_TUCKER</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function disp(tt,name,varargin) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment">Command window display of a QTT_TUCKER</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="rank.html" class="code" title="function [r]=rank(a,varargin)">rank</a>	Computes ranks of the QTT-Tucker tensor</li><li><a href="../../tt2/@tt_matrix/ndims.html" class="code" title="function d = ndims(tt)">ndims</a>	Number of dimensions of a TT-matrix</li><li><a href="../../tt2/@tt_matrix/rank.html" class="code" title="function [r]=rank(a,varargin)">rank</a>	All or individual TT-ranks of a TT-matrix</li><li><a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>	Mode sizes of the TT-matrix</li><li><a href="../../tt2/@tt_tensor/ndims.html" class="code" title="function d = ndims(tt)">ndims</a>	Number of dimensions of a tensor</li><li><a href="../../tt2/@tt_tensor/rank.html" class="code" title="function [r]=rank(a,varargin)">rank</a>	Returns TT-ranks of the given tensor in TT-format</li><li><a href="../../tt2/@tt_tensor/size.html" class="code" title="function [sz] = size(tt,dim)">size</a>	Mode sizes of the TT-tensor</li></ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="display.html" class="code" title="function display(t)">display</a>	Command window display of a QTT-Tucker</li><li><a href="../../tt2/@tt_matrix/display.html" class="code" title="function display(t)">display</a>	Command window display of a TT_MATRIX.</li><li><a href="../../tt2/@tt_tensor/display.html" class="code" title="function display(t)">display</a>	Command window display of a TT_tensor.</li><li><a href="../../tt2/exp/test_qlaplacex_dd.html" class="code" title="">test_qlaplacex_dd</a>	test code for tt_qlaplacex_dd()</li><li><a href="../../tt2/exp/test_qlaplacex_dn.html" class="code" title="">test_qlaplacex_dn</a>	test code for tt_qlaplacex_dn()</li><li><a href="../../tt2/exp/test_qlaplacez_dd.html" class="code" title="">test_qlaplacez_dd</a>	test code for tt_qlaplacez_dd()</li><li><a href="../../tt2/exp/test_qlaplacez_dn.html" class="code" title="">test_qlaplacez_dn</a>	test code for tt_qlaplacez_dn()</li><li><a href="../../tt2/solve/dmrg_eigb.html" class="code" title="function [y,ev] = dmrg_eigb(a,k,eps,varargin)">dmrg_eigb</a>	Find several minimal eigenvalues of a TT-matrix using DMRG method</li></ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function disp(tt,name,varargin)</a>
0002 <span class="comment">%Command window display of a QTT_TUCKER</span>
0003 <span class="comment">%</span>
0004 disp_mode_sizes=false;
0005 <span class="keyword">for</span> i=1:2:length(varargin)-1
0006     <span class="keyword">switch</span> lower(varargin{i})
0007         <span class="keyword">case</span> <span class="string">'modes'</span>
0008             disp_mode_sizes=varargin{i+1};
0009         <span class="keyword">otherwise</span>
0010             error(<span class="string">'Unrecognized option: %s\n'</span>,varargin{i});
0011     <span class="keyword">end</span>
0012 <span class="keyword">end</span>
0013 
0014 <span class="keyword">if</span> ~exist(<span class="string">'name'</span>,<span class="string">'var'</span>)
0015     name = <span class="string">'ans'</span>;
0016 <span class="keyword">end</span>
0017 fprintf(<span class="string">'%s is a QTT-tucker tensor: \n'</span>,name);
0018 fprintf(<span class="string">'Tucker ranks: \n'</span>);
0019 sz=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt.core);
0020 rk=<a href="rank.html" class="code" title="function [r]=rank(a,varargin)">rank</a>(tt.core);
0021 <span class="keyword">for</span> i=1:tt.dphys-1
0022    fprintf(<span class="string">'%d-'</span>,sz(i)); 
0023 <span class="keyword">end</span>
0024 fprintf(<span class="string">'%d\n'</span>,sz(tt.dphys));
0025 fprintf(<span class="string">'TT-ranks for the core: \n'</span>);
0026 <span class="keyword">for</span> i=1:tt.dphys
0027    fprintf(<span class="string">'%d-'</span>,rk(i)); 
0028 <span class="keyword">end</span>
0029 fprintf(<span class="string">'%d\n'</span>,rk(tt.dphys+1));
0030 tk=tt.tuck;
0031 fprintf(<span class="string">'TT-ranks/mode sizes for the factors: \n'</span>);
0032 <span class="keyword">for</span> i=1:tt.dphys
0033    di=<a href="../../tt2/@tt_matrix/ndims.html" class="code" title="function d = ndims(tt)">ndims</a>(tk{i});
0034    ri=<a href="rank.html" class="code" title="function [r]=rank(a,varargin)">rank</a>(tk{i});
0035    ni=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tk{i});
0036    fprintf(<span class="string">'Factor %d: '</span>,i);
0037    <span class="keyword">for</span> j=1:di
0038       fprintf(<span class="string">'%d-'</span>,ri(j));
0039    <span class="keyword">end</span>   
0040    fprintf(<span class="string">'%d\n'</span>,ri(di+1));
0041    <span class="keyword">if</span> ( disp_mode_sizes ) 
0042      fprintf(<span class="string">'Modes   : '</span>);
0043      <span class="keyword">for</span> j=1:di-1
0044        fprintf(<span class="string">'%d-'</span>,ni(j));
0045      <span class="keyword">end</span>
0046      fprintf(<span class="string">'%d\n'</span>,ni(di));
0047    <span class="keyword">end</span>
0048 <span class="keyword">end</span>
0049 <span class="comment">% %fprintf('r(1)=%d \n', r(1));</span>
0050 <span class="comment">% for i=1:d</span>
0051 <span class="comment">%    fprintf('r(%d)=%d \t n(%d)=%d \n',i,r(i),i,n(i));</span>
0052 <span class="comment">% end</span>
0053 <span class="comment">% fprintf('r(%d)=%d \n',d+1,r(d+1));</span>
0054</pre></div>
<hr><address>Generated on Wed 08-Feb-2012 18:20:24 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>